<template>
    <el-row>
        <el-row style="min-width:1300px">
            <el-form :model="formInline"
                class="search_prod"
                label-width="120px">
                <el-form-item label="订单号">
                    <el-col :span="4">
                        <el-col :span="16"
                            class="search_input_width">
                            <el-input size="small"
                                placeholder="订单号"
                                style="width:100%"
                                clearable=""
                                v-model="formInline.oid"></el-input>
                        </el-col>
                    </el-col>
                    <el-col class="tr col_label"
                        :span="3">转入账户&nbsp;&nbsp;&nbsp;</el-col>
                    <el-col :span="4">
                        <el-col :span="16"
                            class="search_input_width">
                            <el-input size="small"
                                placeholder="转入账户"
                                v-model="formInline.username"></el-input>
                        </el-col>
                    </el-col>
                    <el-col class="tr col_label"
                        :span="3">转入昵称&nbsp;&nbsp;&nbsp;</el-col>
                    <el-col :span="4">
                        <el-col :span="16"
                            class="search_input_width">
                            <el-input size="small"
                                placeholder="转入昵称"
                                v-model="formInline.nickname"></el-input>
                        </el-col>
                    </el-col>
                </el-form-item>
                <el-form-item label="转出账户">
                    <el-col :span="4">
                        <el-col :span="16"
                            class="search_input_width">
                            <el-input size="small"
                                placeholder="转出账户"
                                v-model="formInline.other_username"></el-input>
                        </el-col>
                    </el-col>
                    <el-col class="tr col_label"
                        :span="3">转出昵称&nbsp;&nbsp;&nbsp;</el-col>
                    <el-col :span="4">
                        <el-col :span="16"
                            class="search_input_width">
                            <el-input size="small"
                                placeholder="转出昵称"
                                v-model="formInline.other_nickname"></el-input>
                        </el-col>
                    </el-col>
                    <el-col class="tr col_label"
                        :span="3">时间&nbsp;&nbsp;&nbsp;</el-col>
                    <el-col :span="4">
                        <el-col :span="22"
                            class="search_time_width">
                            <el-date-picker style="width:100%"
                                v-model="createTime"
                                type="datetimerange"
                                size="small"
                                align="right"
                                unlink-panels
                                clearable
                                value-format="timestamp"
                                range-separator="-"
                                start-placeholder="开始时间"
                                end-placeholder="结束时间"
                                :picker-options="pickerOptions2">
                            </el-date-picker>
                        </el-col>
                    </el-col>
                </el-form-item>
                <el-form-item>
                    <el-row class="tl">
                        <el-col :span="24">
                            <el-button :loading='$store.state.isLoading'
                                size="mini"
                                type="primary"
                                @click="subOrderInfo">查询</el-button>
                            <el-button :loading='$store.state.isLoading'
                                size="mini"
                                type="primary"
                                @click="delOrderInfo">一键清除</el-button>
                        </el-col>
                    </el-row>
                </el-form-item>
            </el-form>
        </el-row>
    </el-row>
</template>
<script>
export default {
  name: "coinExchangeSearch",
  data() {
    return {
      pickerOptions2: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            }
          }
        ]
      },

      createTime: [],

      formInline: {
        oid: "",
        username: "",
        nickname: "",
        other_username: "",
        other_nickname: "",
        created_time_begin: "",
        created_time_end: ""
      }
    };
  },
  methods: {
    delOrderInfo() {
      this.formInline = {
        oid: "",
        username: "",
        nickname: "",
        other_username: "",
        other_nickname: "",
        created_time_begin: "",
        created_time_end: ""
      };
      this.$emit("sendUserSearch", this.formInline);
    },
    subOrderInfo() {
      this.$emit("sendUserSearch", this.formInline);
    }
  },
  created() {},
  watch: {
    createTime(val) {
      if (val != null) {
        this.formInline.created_time_begin = this.$fnc.phptime(val[0]);
        this.formInline.created_time_end = this.$fnc.phptime(val[1]);
      } else {
        this.formInline.created_time_begin = "";
        this.formInline.created_time_end = "";
      }
    }
  }
};
</script>
<style lang="less" scoped>
.search_prod {
  padding: 10px 20px 0;
  > .el-form-item {
    margin-bottom: 0 !important;
  }
}
.top_weiy {
  position: relative;
  top: -1px;
}
.xz {
  transform: rotate(-90deg);
}
.xzz {
  transform: rotate(90deg);
}
.open_order_search {
  margin-top: 10px;
  span {
    font-size: 13px;
    color: #666;
    cursor: pointer;
  }

  span:hover {
    color: #118bd8 !important;
  }
}
.open_con {
  overflow: hidden;
  transition: all 0.3s linear;
}
</style>
